fix(agentex-ui): bump nanoid 3.3.16 -> 3.3.18 (CVE-2026-67213) - #398
Open
scale-prodsec[bot] wants to merge 1 commit into
Open
fix(agentex-ui): bump nanoid 3.3.16 -> 3.3.18 (CVE-2026-67213)#398scale-prodsec[bot] wants to merge 1 commit into
scale-prodsec[bot] wants to merge 1 commit into
Conversation
nanoid 3.3.16 hangs in an infinite loop when customAlphabet/customRandom are called with size 0 (CVE-2026-67213, HIGH). Pin the transitive dependency (via postcss -> nanoid) to the patched 3.3.x line using the existing overrides block. Stays on the 3.x line: postcss consumes nanoid via require("nanoid/non-secure"), and nanoid 5.x is ESM-only, so 5.1.6 would break the consumer. Verified: npm ci, typecheck, lint, 75 tests, next build, and a direct size-0 repro all pass.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Remediates CVE-2026-67213 (HIGH) in
nanoidfor theagentex-uiservice.nanoid(npm)agentex-uipostcss@8.5.25->nanoidnanoidbefore 3.3.17 / 5.1.6 enters an infinite loop whencustomAlphabet()orcustomRandom()is called withsize = 0— the generation loop never reaches its exitcondition. Availability impact where the size is attacker-influenced.
Why the 3.x line and not 5.1.6
The advisory lists two fixed versions (
3.3.17,5.1.6). 3.3.x is the correct target here:postcss imports nanoid as CommonJS —
require('nanoid/non-secure')(postcss/lib/input.js:3) — and
nanoid 5.x is ESM-only (
"type": "module"). Pinning 5.1.6 would resolve cleanly and thenbreak postcss at runtime. Staying same-major keeps this a lockfile-only change.
Applied through the existing
overridesblock, the convention already used in thismanifest for exactly this purpose (
cross-spawn,postcss,sharp,tar). The floor is^3.3.17(the advisory's fixed version); every version that range can select isadvisory-clean, and it resolved to the latest such release, 3.3.18.
Version gate
nanoid@3.3.17and@3.3.18: zero known advisories.nanoid: ^3.3.16, so no constraint is violated.engines: node ^10 || ^12 || ^13.7 || ^14 || >=15.0.1— compatible with node 20 (Dockerfile + CI).Behavior contract (every version crossed)
Read both releases crossed, not just the endpoints:
if (size <= 0) return ''.The prior behavior was an infinite hang, so no caller can depend on it. No change to error types,
return shapes, defaults, or coercions.
async/index.native.js(React Native infinite-loop fix) + README. Coreindex.cjsis byte-identical to 3.3.17; inert for a Next.js server/browser target.nanoid/non-secure— the only entry point postcss uses — is byte-identical across 3.3.16 -> 3.3.18.agentex-uiimports nanoid,customAlphabet, orcustomRandom.Upstream tracker sweep: ai/nanoid#605 is this exact
CVE, closed as fixed by 3.3.17. No open regression/breaking issues against 3.3.17 or 3.3.18.
Validation
All run locally with npm 10.9.4 / node 20 parity (matching
agentex-ui/Dockerfileand theCI workflow) — not the sandbox default npm 12:
npm ci— passes, lockfile internally consistent and not rewritten (the exact CI + Docker gate)npm ls nanoid --all— single instance:nanoid@3.3.18 overriddennpm run typecheck(CI job) — cleannpm run lint(CI job) — no ESLint warnings or errorsnpm run test:run— 75/75 tests pass (11 files)npm run build— full production build succeeds, all 10 routes generated (exercises postcss/Tailwind)customAlphabet('abcdef',10)(0)andcustomRandom(...)(0)now return""in ~1ms instead of hanging; normal 10-char generation unaffected
postcss.parse()works,nanoid/non-secureexport intactDiff scope
Two files, +4/-3. Exactly one lockfile package entry changed (
node_modules/nanoid);byte-compared the before/after lock to confirm no other entry differs.
lockfileVersionstays3,resolvedstays on the public npm registry, no file-mode changes, no application-codechanges, no dependency additions or removals.
Greptile Summary
The PR raises the transitive nanoid version used by
agentex-uifrom 3.3.16 to 3.3.18 to remediate CVE-2026-67213.^3.3.17nanoid override using the manifest’s existing override mechanism.Confidence Score: 5/5
The PR appears safe to merge with no actionable correctness, compatibility, or security regressions identified.
The override remains within postcss’s accepted nanoid 3.x range, the lockfile consistently resolves the patched version, and the repository’s Node and npm targets support the resulting dependency configuration.
Important Files Changed
Reviews (1): Last reviewed commit: "fix(agentex-ui): bump nanoid 3.3.16 -> 3..." | Re-trigger Greptile